<?php defined('_JEXEC') or die('Restricted access'); ?>

<?php JHTML::_('behavior.tooltip'); ?>

<?php
	$cid = JRequest::getVar( 'cid', array(0) );
	$edit = JRequest::getVar('edit',true);
	$text = intval($edit) ? JText::_( 'Edit' ) : JText::_( 'New' );

	JToolBarHelper::title( 'Serwis maszyn samojezdnych' . ': <small><small>[ '. $text .' ]</small></small>' , 'maszyna.png' );
	JToolBarHelper::save();
	JToolBarHelper::cancel();
	JToolBarHelper::help( 'screen.wykser.edit' );
?>

<?php
	// clean item data
	JFilterOutput::objectHTMLSafe( $this->serwis, ENT_QUOTES, '' );
?>
<script language="javascript" type="text/javascript">
	function submitbutton(pressbutton) 
	{
		var form = document.adminForm;
		if (pressbutton == 'cancel') {
			submitform( pressbutton );
			return;
		}

		// do field validation
		if (trim(form.mss1.value) == "") {
			alert( "Podaj datę naprawy!" );
		} else {
			submitform( pressbutton );
		}
	}
</script>

<form action="index.php" method="post" name="adminForm" autocomplete="off">
	<div class="col">
		<fieldset class="adminform">
		<legend><?php echo 'Naprawa serwisowa'; ?></legend>
			<table class="admintable" cellspacing="1">
				<tr>
					<td width="150" class="key">
						<label for="mss1">
							<?php echo 'Data naprawy'; ?>
						</label>
					</td>
					<td>
						<input type="text" name="mss1" id="mss1" class="inputbox"  style="width:400px;" value="<?php echo $this->serwis->get('mss1'); ?>" />
					</td>
				</tr>
				<tr>
					<td width="150" class="key">
						<label for="mss2">
							<?php echo 'Numer faktury'; ?>
						</label>
					</td>
					<td>
						<input type="text" name="mss2" id="mss2" class="inputbox"  style="width:400px;" value="<?php echo $this->serwis->get('mss2'); ?>" />
					</td>
				</tr>
				<tr>
					<td width="150" class="key">
						<label for="mss3">
							<?php echo 'Skan faktury'; ?>
						</label>
					</td>
					<td>
						<input type="file" name="mss3" id="mss3" class="inputbox"  style="width:400px;" value="<?php echo $this->serwis->get('mss3'); ?>" />
					</td>
				</tr>
				<tr>
					<td width="150" class="key">
						<label for="mss4">
							<?php echo 'Numer raportu serwisowego'; ?>
						</label>
					</td>
					<td>
						<input type="text" name="mss4" id="mss4" class="inputbox"  style="width:400px;" value="<?php echo $this->serwis->get('mss4'); ?>" />
					</td>
				</tr>
				<tr>
					<td width="150" class="key">
						<label for="mss5">
							<?php echo 'Skan raportu serwisowego'; ?>
						</label>
					</td>
					<td>
						<input type="file" name="mss5" id="mss5" class="inputbox"  style="width:400px;" value="<?php echo $this->serwis->get('mss5'); ?>" />
					</td>
				</tr>
				<tr>
					<td width="150" class="key">
						<label for="mss6">
							<?php echo 'Wartość faktury'; ?>
						</label>
					</td>
					<td>
						<input type="text" name="mss6" id="mss6" class="inputbox"  style="width:400px;" value="<?php echo $this->serwis->get('mss6'); ?>" />
					</td>
				</tr>
			</table>
		</fieldset>
	</div>
	<div class="clr"></div>

	<input type="hidden" name="id" value="<?php echo $this->serwis->get('id'); ?>" />
	<input type="hidden" name="cid[]" value="<?php echo $this->serwis->get('id'); ?>" />
	<input type="hidden" name="gid" value="<?php echo $this->serwis->get('gid'); ?>" />
	<input type="hidden" name="option" value="com_serwissj" />
	<input type="hidden" name="task" value="" />
	<?php echo JHTML::_( 'form.token' ); ?>
</form>
